import cv2
# concatenated_image = np.concatenate((image1, image2), axis=1)
FRAME_NUM = 5

def save_video(video_writer, frame, output_dir, video_name):
    out_path = f"{output_dir}{video_name}.mp4"
    if video_writer is None:
        video_writer = cv2.VideoWriter(out_path, cv2.VideoWriter_fourcc(*'mp4v'), FRAME_NUM, (1600, 1600))
    video_writer.write(frame)
    return video_writer